package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-17
 * Time: 10:42
 */
public class BookList {
    private Book[] books=new Book[50];//这里最多可以放置5本书
    private int usedSized=3;//已存数的数量

    public BookList() {
        books[0]=new Book("红楼梦","曹","小说",11);
        books[1]=new Book("红楼","网","说",1111);
        books[2]=new Book("红","照","小",111111);
    }

    public void setBooks(int pos,Book book) {//设置某个位置的书，用于查找和删除图书
        this.books[pos]=book;
    }

    public void setUsedSized(int usedSized) {
        this.usedSized = usedSized;
    }

    public Book getBooks(int pos) {//获取某个位置的书，返回值为对象
        return this.books[pos];
    }
    public int getUsedSized() {
        return usedSized;
    }
}
